package com.ss.baseinfo.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ss.baseinfo.dao.CollegeDao;
import com.ss.baseinfo.pojo.CollegeInfo;
/**
 * 学院管理
 * @author Administrator
 *
 */
@Repository("collegeDao")
public class CollegeDaoImpl extends SqlMapClientDaoSupport implements CollegeDao  {

	@Override
	public void add(CollegeInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("college.addCollege",info);
	}

	@Override
	public int update(CollegeInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("college.updateCollege",info);
	}

	@Override
	public List<CollegeInfo> query() throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("college.queryCollege");
	}

	@Override
	public CollegeInfo getOneById(String id) throws Exception {
		// TODO Auto-generated method stub
		return (CollegeInfo)this.getSqlMapClientTemplate().queryForObject("college.getCollegeById",id);
	}

}
